package com.thiswhyme.common.utils;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by thiswhyme on 2019-11-15.
 */
public class BizStringUtils {

    /**
     * string转list
     * @param txt
     * @param separator
     * @return
     */
    public static List<Long> string2LongList(String txt, String separator) {
        if(txt != null && !txt.isEmpty()) {
            return Collections.emptyList();
        }
        String[] list = txt.split(separator);
        return Arrays.stream(list).map(Long::parseLong).collect(Collectors.toList());
    }
}
